package com.xuelangyun.job;

import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/** @Version 1.0 @Author:xinyan @Date:2022/4/16 @Content: */
@Component // 将该对象交给IOC容器进行实例化
public class TaskJob {
  public void job1() {
    System.out.println("任务 1:" +
            new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
  }

  public void job2() {
    System.out.println("任务 2:" + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
  }
}
